/*
 * master_manager.h
 *
 *  Created on: Jan 12, 2013
 *      Author: redchen
 */

#ifndef MASTER_MANAGER_H_
#define MASTER_MANAGER_H_

#ifdef __cplusplus
extern "C" {
#endif

void master_manager_init();

Status master_manager_file_create(const char* namespace, int32_t min_replica, int32_t max_replica);

/**
 * Write data to file and get new chunk id
 *
 * @param namespace [The namespace of file which is writing]
 * @param size [The size of writing data]
 * @param id [output parameter, new chunk id]
 * @return [Status of lfs]
 */
Status master_manager_file_write(const char* namespace, int64_t size, /*out*/int64_t** id);

Status master_manager_file_meta(const char* namespace, /*out*/MetaFile* mfile);

Status master_manager_file_meta_update(const char* namespace, MetaFile* mfile);

Status master_manager_file_delete(const char* namespace);

#ifdef __cplusplus
}
#endif


#endif /* MASTER_MANAGER_H_ */
